 function return_login () {
 
        location.href = "/login";
      
}
function regis(){
         var name = document.getElementById('name').value;
        var myname = document.getElementById('user').value;
        var pass = document.getElementById('pass').value;
        var sex = document.getElementById('sex').value;
        var age = document.getElementById('age').value;
        var address = document.getElementById('address').value;
        var email = document.getElementById('email').value;
        var phone = document.getElementById('phone').value;

       // alert(myname+pass+sex+age+address+email+phone);
        if (name == "" || myname == "" || pass == "" || sex == "" || age == "" || address == "" || email == "" || phone == ""){
            document.getElementById('myModalLabel').innerHTML = "你的参数还未填写完整!";
            $('#myModal').modal('show');
            return
        }else{
            var target = "http://"+window.location.host+"/regis";//--获取地址
           // alert(location.href);
            var user = {
                "name":name,
                "user":myname,
                "pass":pass,
                "sex":sex,
                "age":age,
                "address":address,
                "email":email,
                "phone":phone
            };
            $.ajax({
            type:'POST',
            async:false,
            url:target,
            data:user,
            dataType:"json",
            success: function(ret){    
              
                if(ret.Code == 2){
                    document.getElementById('myModalLabel').innerHTML = "注册成功!";
                    $('#myModal').modal('show');
                 }else{
                    document.getElementById('myModalLabel').innerHTML = "注册失败!";
                    $('#myModal').modal('show');
                 }
            }
            });
        }
        
}